package com.jsmile.cloud.tradecenter.api.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmile.cloud.tradecenter.api.constants.TradeConstants;
import com.jsmile.cloud.tradecenter.api.req.ReqOrderDetail;
import com.jsmile.cloud.tradecenter.api.req.ReqOrderQuery;
import com.jsmile.cloud.tradecenter.api.res.ResOrder;
import com.jsmile.mall.api.JSmileResult;
import com.jsmile.mall.api.to.JsmilePage;

@FeignClient(value = TradeConstants.APPLICATION_NAME, contextId = "orderSearch")
public interface OrderSearchServiceApi {

    @RequestMapping(value = "/feign/order/search/findAll", method = RequestMethod.POST)
    JSmileResult<JsmilePage<ResOrder>> findAll(@RequestBody @Valid ReqOrderQuery reqOrderQuery);

    @RequestMapping(value = "/feign/order/search/findByOrderNo", method = RequestMethod.POST)
    JSmileResult<JsmilePage<ResOrder>> findByOrderNo(@RequestBody @Valid ReqOrderDetail reqOrderDetail);

    @RequestMapping(value = "/feign/order/search/findBySimpleOrderNo", method = RequestMethod.POST)
    JSmileResult<JsmilePage<ResOrder>> findBySimpleOrderNo(@RequestBody @Valid ReqOrderDetail reqOrderDetail);
}
